package com.zmx.b2c.order.dto.result;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
@ToString
public class OrderItemResultDTO implements Serializable {

    private static final long serialVersionUID = 1259604995104616232L;

    private Long id;

    private Long orderId;

    private Long activeId;

    private Long productId;

    private BigDecimal price;

    private String name;

    private Integer quantity;

    private String specification;

    private String size;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") //入参
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") //出参
    private Date createTime;

    private String image;

    public OrderItemResultDTO() {

    }

    public OrderItemResultDTO(Long activeId, Long productId, BigDecimal price, String name, Integer quantity) {
        this.activeId = activeId;
        this.productId = productId;
        this.price = price;
        this.name = name;
        this.quantity = quantity;
    }
}